package com.neu.cloudfactory.repository;

import com.neu.cloudfactory.bean.Order.Ordering;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface OrderRepository extends JpaRepository<Ordering,Integer> {
    List<Ordering> findAllByProductid(int id);
    boolean existsByNumber(String number);
    Page<Ordering> findAllByUserid(int userid,Pageable pageable);
    Page<Ordering> findAllByStatusidBetween(Integer statusidstart,Integer stausidend,Pageable pageable);
    Optional<Ordering> findById(Integer id);
    boolean existsByProductid(Integer productid);
    List<Ordering> findAllByProductid(Integer productid);
}
